package net.homeip.jcperera.webinfo;

import java.io.Serializable;

import javax.inject.Named;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import net.homeip.jcperera.nu.model.entity.PersistentEntity;

@Entity
@Table(name = WebInfoValue.tableName)
@Named(WebInfoValue.componentName)
@Inheritance(strategy = InheritanceType.JOINED)
public class WebInfoValue extends PersistentEntity implements Serializable
{
    private static final long  serialVersionUID = 4242144843191287302L;

    // CoreBase properties, for easy use from other components, as well as logging
    public static final int    runtimeLevel     = 5;
    public static final String moduleName       = "webinfo";
    public static final String componentName    = "webinfo_webinfovalue";

    // All persistent entities should specify a table name
    public static final String tableName        = "WEB_INFO_VALUE";

    @ManyToOne
    @JoinColumn(name = "PATTERN", nullable = false)
    private WebInfoPattern     pattern;

    @Basic
    @Column(name = "MATCHINGREGEX")
    private String             matchingRegex    = "";

    @Basic
    @Column(name = "FOLLOWUPENABLED")
    private Boolean            followUpEnabled  = false;

    @Basic
    @Column(name = "PENDINGCHECK")
    private Boolean            pendingCheck   = false;

    public WebInfoPattern getPattern()
    {
        return pattern;
    }

    public void setPattern(WebInfoPattern pattern)
    {
        this.pattern = pattern;
    }

    public String getMatchingRegex()
    {
        return matchingRegex;
    }

    public void setMatchingRegex(String matchingRegex)
    {
        this.matchingRegex = matchingRegex;
    }

    public Boolean getFollowUpEnabled()
    {
        return followUpEnabled;
    }

    public void setFollowUpEnabled(Boolean followUpEnabled)
    {
        this.followUpEnabled = followUpEnabled;
    }

    public Boolean getPendingCheck()
    {
        return pendingCheck;
    }

    public void setPendingCheck(Boolean pendingCheck)
    {
        this.pendingCheck = pendingCheck;
    }
}
